
const axios = require('axios');
const FormData = require('form-data');
axios.defaults.withCredentials = true

let mydata = new FormData();
mydata.append('Cookie', "token=it_token:1656853695.91139584578");
mydata.append('Accept', "application/json, text/plain, */*");
mydata.append('Content-Type', "application/json;charset=UTF-8");



// mid_fly.factflypassenger
axios({
    method: 'POST',
    url: 'http://bds.17usoft.com/saipan/api/ergate/queryLog',
    data: {
        "async": true,
        "dataSourceType": "hive",
        "executeSql": "select * from mid_hotel.hotel_flow_newubt_di where logdate=20230325 limit 10",
        // "executeSql": "select * from mid_hotel.hotel_flow_newubt_di where logdate=20230325 limit 10",
        "searchType": "DOWNLOAD",
        "downloadType": "EXCEL",
        "clearCache": false,
        "queryNotice": false,
        "tenant": "flightdap",
        "tabTitle": "Hive 2",
        "commentCheck": true,
        "dbId": 195,
        "maxLimit": 500000,
        "queryKey": "qj4TSOo5ggjxWAxeBG96Hw==",
        "jobNum": "1002998",
        "userName": "吴文波"
    },
    headers: {
        // 'authority': 'bbs.fanruan.com',
        'method': 'POST',
        'scheme': 'http',
        'content-type': 'application/json;charset=UTF-8',
        // 'Accept-Encoding': "gzip, deflate",
        // 'Accept-Language': "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ko-KR;q=0.6,ko;q=0.5,ja-JP;q=0.4,ja;q=0.3",
        // "Cache-Control": "no-cache",
        // "Connection": "keep-alive",
        // "Content-Length": "0",
        "Cookie": `sp_access_token=94e4c4a443f0f91ee7bf2b8c8a899012; saipansession=s%3A7sO-wNZMEkyahqXFeVqdY8DMGyEa354Z.yMOARXgxAB%2FYOJLLSknLaUyVk2%2B1a%2B8XN7Tetgcun1E; __tctma=102596417.1658822012412763.1658822012453.1685629623173.1685673223645.244; __tctmu=102596417.0.0; __tctmz=102596417.1685673223645.244.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); longKey=1658822012412763; __tctrack=0; route=66e455007072e4d46f9030d9b6ce6f5c; __tctmc=102596417.28181487; __tctmd=102596417.99092941; __tctmb=102596417.1399348403579376.1685673245944.1685673245944.4`,
        // 'DNT': '1',
        // 'Host': ' tcoa.17usoft.com',
        'Origin': 'http://bds.17usoft.com',
        'Referer': 'http://bds.17usoft.com/saipan/ergate/custom/search',
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36',
    }

}).then(res => {
    console.log('start log data');
    console.log('res:', res.data);
    // console.dir('data2:', res);
    // console.dir(res.data.simpleMessageRecordLogger.eventQueue)
    let num = 0;
    for (let kk of res.data.resultRowSet.rows) {
        console.log(++num,kk);
        num++;
        // if (num >= 5) break
    }
    console.log('end log data')
}).catch(err => {
    console.error('error',err.response.data)
    console.error('error',err.response.config.data)
})



















// Hm_lvt_86ccbbb8b851ebc52cb32e83a3eaa3f9 = 1675833182;
// Hm_lvt_6233c395aa2a56faa6a394aebe4818e1 = 1675833293;
// Meeting_EmpInfo = YybLSGfQ3j6ZfF5U75Ygi5HM / ojp5i2F5J9G3W34 + GKbh4Bl1LCdnA ==;
// __tctmu = 102596417.0.0;
// __tctmz = 102596417.1680066496484.171.1.utmccn = (direct) | utmcsr=(direct) | utmcmd=(none);
// longKey = 1658822012412763; __tctrack = 0;
// userInfo = { "UserId": "1206058", "DepartmentId": 8564 };
// ASP.NET_SessionId = vjbriwxwvcbamo14pkiidi0v;
// __tccgd = 102596417.0;
// oastate = ec6a581b90f3467692347606c7ed2275;
// access_token = 0f1c848396c6b042737128e201c305f6;
// TCOA_Global_ManageUnitCookie = UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090;
// TCOA_Global_MainManageUnitCookie = UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090;
// portal_access_token = 5542b44d998cae339f4ca5eb7cc94697;
// portal_user_info = 25trTcF5gRqVzZFGhAd8Wu0kq7 / VDlZPge0nGBcGikEuMxRGNP3im1UH1fj9OgHbHuTLo + qLPunpX7Bi2UT6bDpNCRPjThBbe + jSBJLIDDc6ti9LuQb5f4GwBP / pu / FAsB0ghoCZZPhqAdfUAzyWtme9ug2A8hfjjjG4SAkPyWVI / UwLYNPhezRfZO0CdYJarFOPWcgjvslIDmne4 / FWyG9RQx6BItvnJbhBsxLD9X30BHMklEHLBq6qTywm6EC3ZdF / Z + PUFzA8uImmR7 + poE2QbDVIRVa + 2dntWNJxtrUNZb9mN7QnyfhKfpqN2TVNjzqkZ0BgMSUon8vLKlP / gIvfMcvA1hUSZ0xCHoMFWRbjg6nq5hHFW13 / qjlC2Gofc51dKriLwf5uvtfmtM2EfhHo62XreUbdX9N + ZPEaknIFwqMY3S0dcOgECXpnEqhDmHWhoFvAWovqDvKMac + cN71IsMJZ4dlxBVg2iNdqLokFiIWECxiFF8BzxN4poU0LDqDEB2lZdmE9Imoh2fFI0LHUD88lPAFGQEIJBisPTE4QNUxw8PG4NkeGbrQOGgs1jPow / hB1Kn5IK / h4Ul / eIyEI7pONiTicrm5NQ3bYpvb9JRV2gABpOA / +P5SPqzDgRWHlElj5StrPxQgK8CY6klCBiRVfHQNuGr + c8KOPoSYMD4alJT8bygAahdci6PxAXEgsH1 / RR + 7Y0GyaNXXfEA ==;
// TCOA_Global_Cookie = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo =;
// NEW_OA_PORTAL_Global_Cookie = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo =;
// emall_access_token = d743603b29915e4e78d9dddf9b5eb140;
// emall_user_info = Zdm7uLSzjZ1dsvyBib1gRb8ZtXxBuypoghhBG / hTOFpH / oCDoUsi6rCM9EI + WTyL37 + EltNojZqjGeF5wNbheocyHziCZBQkKkFeHjhS8wul4rE4LN9NuynoLr8Qs8g5typJ8SoI88jwIgst + R8wlMH0QxbqmOQfJCLbg3ty4Eo1LZQ + MA8qX61c9PTNZQRpf4l84UAvii68cWfkt8cGB25Fgm4SwI7RsCLGobKeUTXBSNLjSmMldwarJV0YLRJkDvS9YCg8F8HRn1dSppLmhTM3vRzUb4UuNmlXZSmM + zd + pfiTpJ6oAt295CZVezLcGp8X6PkVu3ufHdzVzCuUJTKX7eoT / qPlvGL3ERfCfmOzS09lhh33ZyIGeCtLDHAzZ2sRaBeaaC + 36Lj4925zNRpLiP6H + aTCIVhm3x7EdmnFJSfQX / 6iUSJlsHus8qaaFQHo5eQL / BZ9f8iaAbXDV2aSBJJ623GBBSGROJxnaqTEPE2yANNG355Z6GpFELfLREyIuJvtlEERacAVTPmbd0RgZ + zeYyrYyJOMP9qIrgXXq0zgE1goc7FTb6QjhiEIAmErbUwjUnm9EneeXvdef0 + jdzTL / wBpfVsWCt + TmMs3zk22cfJGIbiuNEQvyP294PPItNFnzNoX5MdiI4TjigWIhYQLGIUXwHPE3imhTQuZfrFMo3bZPRBmpHG7iZ9YnI0pzNnJLQMAxuHc24pMnAe1xoRqQ5RYDUDpZl5af1K2K9dH6lj0PTN1WAL + I4fKZGTJvyrxwkYyHmYHZCO922 / sWUnBjsGLoo6Q0l1OLMctX9Hij5t4An2L / kRpGbYMTjjz8hS1mD / 54Iz7Hh2sVyllmquwqqsajwdYmMJGmjmozRZFSepgiKHdOLs8ST0s;
// TCOA_Global_Cookie_Last = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo % 3D;
// __tctmc = 102596417.93733272; __tctmd = 102596417.128401801;
// __tctma = 102596417.1658822012412763.1658822012453.1680143557390.1680152402071.177;
// __tctmb = 102596417.3300621494459652.1680152402071.1680152402071.1;
// route = f30cd0111cbbaccc618b97d6c8e8a311




// oastate = a7a0e9e69e524acfaf4b81957fc9d373;
// ASP.NET_SessionId = s5hymopy0le4eqm3t0k5gcbd;
// access_token = 180dc3157001f1e9ebab99aabf9a4e56;
// TCOA_Global_ManageUnitCookie = UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090;
// TCOA_Global_MainManageUnitCookie = UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090;
// portal_access_token = 5bd548eaefd59af5509b36f9f17b469b;
// portal_user_info = 25trTcF5gRqVzZFGhAd8Wu0kq7 / VDlZPge0nGBcGikEuMxRGNP3im1UH1fj9OgHbHuTLo + qLPunpX7Bi2UT6bDpNCRPjThBbe + jSBJLIDDc6ti9LuQb5f4GwBP / pu / FAsB0ghoCZZPhqAdfUAzyWtme9ug2A8hfjjjG4SAkPyWVI / UwLYNPhezRfZO0CdYJarFOPWcgjvslIDmne4 / FWyG9RQx6BItvnJbhBsxLD9X30BHMklEHLBq6qTywm6EC3ZdF / Z + PUFzA8uImmR7 + poE2QbDVIRVa + 2dntWNJxtrUNZb9mN7QnyfhKfpqN2TVNjzqkZ0BgMSUon8vLKlP / gIvfMcvA1hUSZ0xCHoMFWRbjg6nq5hHFW13 / qjlC2Gofc51dKriLwf5uvtfmtM2EfhHo62XreUbdX9N + ZPEaknIFwqMY3S0dcOgECXpnEqhDmHWhoFvAWovqDvKMac + cN71IsMJZ4dlxBVg2iNdqLokFiIWECxiFF8BzxN4poU0LDqDEB2lZdmE9Imoh2fFI0LHUD88lPAFGQEIJBisPTE4QNUxw8PG4NkeGbrQOGgs1jPow / hB1Kn5IK / h4Ul / eIyEI7pONiTicrm5NQ3bYpvb9JRV2gABpOA / +P5SPqzDgRWHlElj5StrPxQgK8CY6klCBiRVfHQNuGr + c8KOPoSYMD4alJT8bygAahdci6PxAXEgsH1 / RR + 7Y0GyaNXXfEA ==;
// TCOA_Global_Cookie = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo =;
// NEW_OA_PORTAL_Global_Cookie = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo =;
// __tctmc = 102596417.93733272;
// __tctmd = 102596417.128401801;
// __tctma = 102596417.1680153944760361.1680153944515.1680153944515.1680153944515.1;
// __tctmb = 102596417.1598452457084860.1680153944515.1680153944515.1;
// __tctmu = 102596417.0.0;
// __tctmz = 102596417.1680153944515.1.1.utmccn = (direct) | utmcsr=(direct) | utmcmd=(none);
// longKey = 1680153944760361;
// __tctrack = 0;
// Meeting_EmpInfo = YybLSGfQ3j6ZfF5U75Ygi5HM / ojp5i2F5J9G3W34 + GKbh4Bl1LCdnA ==;
// userInfo = { "UserId": "1206058", "DepartmentId": 8564 };
// TCOA_Global_Cookie_Last = OkuznJ35Mp1u1mvH4jXjnSq8WN4jfTpYhPX4TwxIi0AkCNtedvjjwHj6PPTjlNyUegvgyq4rqfAgrCJkrWNC49cwbjAWe4zSJ7UaYaHauZo % 3D;
// route = 3904cf2552db7521e1913f68d320fedc